package xhwl.insurance.http.api;

import com.google.gson.Gson;

import okhttp3.RequestBody;
import rx.Observable;
import xhwl.android.common.util.SPUtil;
import xhwl.insurance.Constant;
import xhwl.insurance.http.ApiService;
import xhwl.retrofitrx.BaseApi;

/**
 * Created by admin on 2017/6/7.
 * 心电阅片订单列表
 */

public class YuePianOrderApi extends BaseApi {
    YuePianOrderReq req;

    public YuePianOrderApi(int page_num) {
        req = new YuePianOrderReq(page_num);
    }

    @Override
    protected Observable getObservable() {
        RequestBody requestBody = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), new Gson().toJson(req));
        return retrofit.create(ApiService.class).orderlistyuepian(requestBody);
    }

    class YuePianOrderReq {
        /**
         * page_num : 0
         * link_mobile : 13263266381
         * yw_id : 2
         */

        private int page_num;
        private String link_mobile;
        private String yw_id;

        public YuePianOrderReq(int page_num) {
            this.page_num = page_num;
            this.link_mobile = SPUtil.getPersonInfoSp().getString(SPUtil.SPPersonInfo.LINK_MOBILE,"");
            this.yw_id = Constant.YW_ID;
        }
    }
}
